package com.example.leavemanagement.model.vo;


import cn.hutool.json.JSONUtil;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.example.leavemanagement.model.entity.LeaveInfo;
import com.example.leavemanagement.model.entity.User;
import lombok.Data;
import org.springframework.beans.BeanUtils;

import java.io.Serializable;
import java.util.Date;

/**
 * @author 黄宽亮
 * @version 1.0
 * @description: TODO
 * @date 2025/4/28 20:14
 */
@Data
public class LeaveVo implements Serializable {
    private static final long serialVersionUID = -4102720923948535347L;
    /**
     * 请假信息ID
     */
    private Long id;

    /**
     * 请假事由
     */
    private String leaveReason;

    /**
     * 请假名称
     */
    private String name;

    /**
     * 请假类型
     */
    private String category;

    /**
     * 活动地点
     */
    private String address;

    /**
     * 申请人ID
     */
    private Long userId;

    /**
     * 申请时间
     */
    private Date createTime;

    /**
     * 编辑时间
     */
    private Date editTime;

    /**
     * 更新时间
     */
    private Date updateTime;

    /**
     * 是否删除
     */
    private Integer isDelete;

    /**
     * 审核状态：0-待审核; 1-通过; 2-拒绝
     */
    private Integer reviewStatus;

    /**
     * 审核信息
     */
    private String reviewMessage;

    /**
     * 审核时间
     */
    private Date reviewTime;

    /**
     * 部门
     */
    private String section;

    /**
     * 审核人
     */
    private UserVo user;

    /**
     * 审核人ID
     */
    private Long reviewerId;


    public static LeaveVo objToVo(LeaveInfo leaveInfo) {
        LeaveVo leaveVo = new LeaveVo();
        BeanUtils.copyProperties(leaveInfo, leaveVo);
        return leaveVo;
    }
}
